package com.morgan.test;

import java.util.LinkedList;
import java.util.List;

public class CTLinkedList {
    
    public static void main (String[] args) {
        
        List<String> orignalStr = new LinkedList<String>();
        for (int i = 0; i < 2000 ; i++) {
            orignalStr.add(String.valueOf(i));
        }

        int loop = 0;
        List<String> columnLinkList = null;
        List<List<String>> finalLinkList = new LinkedList<List<String>>();
        for (String link : orignalStr) {
            if (loop % 8 == 0) {
                columnLinkList = new LinkedList<String>();
                finalLinkList.add(columnLinkList);
            }
            loop++;
            columnLinkList.add(link);
        }
        
        
        for (List<String> strList : finalLinkList) {
            StringBuffer sb = new StringBuffer();
            for (String str : strList) {
                sb.append(str + "   ");
            }
            System.out.println(sb.toString());
        }
    }

}
